//
// Created by zhengjuping on 24-9-9.
//

#ifndef ENV_II_BT_BLESERVER_H
#define ENV_II_BT_BLESERVER_H
#include "GattsApplication.h"

class BleServer {
public:
    static BleServer *instance(void);

    virtual ~BleServer() = default;
    void probe(void);
    void setGattsApplication(const std::shared_ptr<GattsApplication> &application);


private:
    BleServer() = default;
    std::shared_ptr<GattsApplication> _application = nullptr;

    static void gapEventCallback(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t* param);
    static void gattsEventCallback(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t* param);

    friend GattsApplication;
};


#endif //ENV_II_BT_BLESERVER_H
